/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.risk.control.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hopes.bizz.risk.control.dto.RiskMeasureTaskDTO;
import com.hopes.bizz.risk.control.entity.RiskMeasureTaskEntity;
import com.hopes.bizz.risk.control.vo.RiskMeasureTaskVO;
import com.hopes.bizz.risk.statistic.bo.SafetyStatisticsBO;
import com.hopes.bizz.risk.statistic.dto.SafetyStatisticsDTO;
import com.hopes.boss.common.data.datascope.BossBaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 隐患排查任务设置
 *
 * @author pig
 * @date 2023-07-20 09:01:45
 */
@Mapper
public interface RiskMeasureTaskMapper extends BossBaseMapper<RiskMeasureTaskEntity> {

    /**
     * 分页查询
     *
     * @param page
     * @return
     */
    Page<RiskMeasureTaskVO> listPage(Page<RiskMeasureTaskVO> page, @Param("entity") RiskMeasureTaskDTO entity);

    /**
     * 列表查询
     *
     * @param entity      查询参数
     * @param orderColumn 排序
     * @return 查询结果
     */
    List<RiskMeasureTaskVO> queryForList(RiskMeasureTaskEntity entity, @Param("orderColumn") String orderColumn);


    int updateNotEmpty(RiskMeasureTaskEntity entity);

    // 包保责任人任务统计
    List<SafetyStatisticsBO> getTaskCountByStatusType(SafetyStatisticsDTO entity);

    List<RiskMeasureTaskEntity> queryListByRiskUnitIdList(List<String> list);

    @Select("select * from risk_measure_task where uid = #{uid}")
    RiskMeasureTaskEntity getByUid(String uid);
}
